<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>jq-get方法</title>
    <script src="lib/jquery_3.2.1_jquery.js"></script>
    <script type="text/javascript"> $(function () {

        $("input").click(function () {
            $.get("jingdian.json", function (data) {
                var data = data;
                var str = "<table  border=1 width=100%>";
                str += "<tr>";
                for (var n in data[0]) {
                    str += "<th>" + n + "</th>";
                }
                str += "</tr>";
                for (var i = 0; i < data.length; i++) {
                    str += "<tr>";
                    for (var n in data[i]) {
                        str += "<td align='center'>" + data[i][n] + "</td>";
                    }
                    str += "</tr>";
                }
                str += "</table>";
                $("div").html(str);
            })
        })
    })</script>
</head>
<body><input type="button" value="向服务器发出异步请求"/>
<div></div>
</body>
</html>
